package com.cheche.dn.domain;

import com.cheche.dn.domain.admin.Authority;
import com.google.common.collect.Sets;

import java.util.Set;

/**
 * Created by cheshun on 16/1/11.
 */
public interface Authorities extends Apis {

    Authority SUPER_ADMIN = new Authority("/**", null, "超级管理员");

    Authority ADMINS_POST = new Authority(ADMINS_POST_MAPPING, "创建管理员");
    Authority ADMINS_SELF_GET = new Authority(ADMINS_SELF_GET_MAPPING, "获取当前管理员");
    Authority ADMINS_ID_GET = new Authority(ADMINS_ID_GET_MAPPING, "获取管理员详情");
    Authority ADMINS_GET = new Authority(ADMINS_GET_MAPPING, "获取管理员列表");
    Authority ADMINS_PASSWORD_PATCH = new Authority(ADMINS_PASSWORD_PATCH_MAPPING, "管理员修改自己密码");
    Authority ADMINS_ID_PASSWORD_PATCH = new Authority(ADMINS_ID_PASSWORD_PATCH_MAPPING, "重置指定管理员密码");
    Authority ADMINS_ID_ROLES_POST = new Authority(ADMINS_ID_ROLES_POST_MAPPING, "添加管理员角色");
    Authority ADMINS_ID_ROLES_DELETE = new Authority(ADMINS_ID_ROLES_DELETE_MAPPING, "删除管理员角色");
    Authority AUTHORITIES_GET = new Authority(AUTHORITIES_GET_MAPPING, "获取全部权限列表");
    Authority ROLES_POST = new Authority(ROLES_POST_MAPPING, "创建角色");
    Authority ROLES_GET = new Authority(ROLES_GET_MAPPING, "获取角色列表");
    Authority ROLES_PUT = new Authority(ROLES_PUT_MAPPING, "修改角色");
    Authority ROLES_ID_AUTHORITIES_POST = new Authority(ROLES_ID_AUTHORITIES_POST_MAPPING, "添加角色权限");
    Authority ROLES_ID_AUTHORITIES_DELETE = new Authority(ROLES_ID_AUTHORITIES_DELETE_MAPPING, "删除角色权限");
    Authority ROLES_DELETE = new Authority(ROLES_DELETE_MAPPING, "删除多个角色");
    Authority ROLES_ID_DELETE = new Authority(ROLES_ID_DELETE_MAPPING, "删除单个角色");
    Authority ROLES_ID_GET = new Authority(ROLES_ID_GET_MAPPING, "获取角色详情");
    Authority USERS_GET = new Authority(USERS_GET_MAPPING, "获取用户列表");
    Authority USERS_POST = new Authority(USERS_POST_MAPPING, "添加用户");

    Set<Authority> values = Sets.newHashSet(
            ADMINS_POST, ADMINS_SELF_GET, ADMINS_ID_GET, ADMINS_GET, ADMINS_PASSWORD_PATCH, ADMINS_ID_PASSWORD_PATCH, ADMINS_ID_ROLES_POST, ADMINS_ID_ROLES_DELETE,
            AUTHORITIES_GET,
            ROLES_POST, ROLES_GET, ROLES_PUT, ROLES_ID_AUTHORITIES_POST, ROLES_ID_AUTHORITIES_DELETE, ROLES_DELETE, ROLES_ID_DELETE, ROLES_ID_GET,
            USERS_GET, USERS_POST
    );
}
